package com.cty.controller;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


/**
 * @Auther: cty
 * @Date: 2020/3/12 15:52
 * @Description: 控制器
 * @version: 1.0
 */
@WebServlet(name = "DemoController")
public class DemoController implements Controller {

    @Override
    public ModelAndView handleRequest(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
        System.out.println("执行了springmvc的控制器");
        // 跳转到指定视图
        ModelAndView mav = new ModelAndView("demo");
        return mav;
    }
}
